import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:industry_net/base/common/util.dart';
import 'package:industry_net/pages/news/news_reply/index.dart';

class NewsReplyNavBar extends StatelessWidget {
  NewsReplyNavBar({Key? key}) : super(key: key);
  final controller = Get.find<NewsReplyController>();
  final state = Get.find<NewsReplyController>().state;
  @override
  Widget build(BuildContext context) {
    return Container(
      height: buttonHeight,
      alignment: Alignment.bottomLeft,
      decoration: BoxDecoration(
        color: ColorsUtil.white,
        borderRadius: BorderRadius.vertical(top: Radius.circular(25.r)),
      ),
      child: SizedBox(
        height: double.infinity,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            IconButton(
                onPressed: () {},
                icon: loadImage(
                    url: 'icon_reload.png'.imgPathNews,
                    width: 12.5.r,
                    height: 15.5.r)),
            state.isShowUser
                ? Expanded(
                    child: Container(
                    alignment: Alignment.center,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        loadAvater(size: 30.r),
                        RichText(
                          text: TextSpan(
                              text: '上岸必有我',
                              style: pfMediumStyle(
                                  color: ColorsUtil.subTitle, fontSize: font13),
                              children: [
                                WidgetSpan(
                                    child: Container(
                                  margin: EdgeInsets.only(left: 5.r),
                                  padding:
                                      EdgeInsets.symmetric(horizontal: 3.r),
                                  decoration: BoxDecoration(
                                      color: const Color(0xffdff3e8),
                                      borderRadius: BorderRadius.circular(2.r)),
                                  child: Text(
                                    '小编',
                                    style: pfMediumStyle(
                                        color: ColorsUtil.green,
                                        fontSize: font10),
                                  ),
                                ))
                              ]),
                        ),
                      ],
                    ),
                  ))
                : Text(
                    '12条回复',
                    style: pfSCStyle(color: ColorsUtil.title, fontSize: font14),
                  ),
            IconButton(
              onPressed: Get.back,
              icon: loadImage(
                url: 'icon_wrong.png'.imgPathNews,
                width: 12.r,
                height: 12.r,
              ),
            )
          ],
        ),
      ),
    );
  }
}
